import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/pages/home/Home.vue'
import Search from '@/pages/search/Search.vue'
import DepmapExplore from '@/pages/depmapExplore/DepmapExplore.vue'
import EcDetail from '@/pages/search/EcDetail.vue'
import Manual from '@/pages/manual/Manual.vue'
import Download from '@/pages/download/Download.vue'
import Contact from '@/pages/contact/Contact.vue'
import Analysis from '@/pages/depmapExplore/Analysis.vue'
import DepDetail from '@/pages/depmapExplore/DepDetail.vue'
import Browse from '@/pages/browse/Browse.vue'
import BrowseDetail from '@/pages/browse/BrowseDetail.vue'
import Cytoscape from '@/pages/depmapExplore/cytoscape/Cytoscape.vue'
import NotFound from '@/pages/notFound/NotFound.vue'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: '/',
            component: Home
        },
        {
            path: '/home',
            name: 'home',
            component: Home
        },
        {
            path: '/search/:OncotreeLineage?/:Type?/:Cellline?/:Tab?/:group?/:value?',
            name: 'search',
            meta: {
                keepAlive: true
            },
            component: Search
        },
        {
            path: '/manual',
            name: 'manual',
            component: Manual
        },
        {
            path: '/download',
            name: 'download',
            component: Download
        },
        {
            path: '/contact',
            name: 'contact',
            component: Contact
        },
        {
            path: '/ecDetail/:filename/:circ/:OncotreeLineage/:MajorTumorType/:Cellline/:SampleType',
            name: 'ecDetail',
            component: EcDetail
        },
        {
            path: '/depmapExplore/cytoscape',
            name: 'cytoscape',
            component: Cytoscape
        },
        {
            path: '/depmapExplore/:dataType?/:target?/:tumortype',
            name: 'depmapExplore',
            meta: {
                keepAlive: true
            },
            component: DepmapExplore
        },
        {
            path: '/depmapExplore/analysis',
            name: 'analysis',
            meta: {
                keepAlive: true
            },
            component: Analysis
        },
        {
            path: '/depDetail/:dataType/:Target/:TumorType',
            name: 'depDetail',
            component: DepDetail
        },
        {
            path: '/browse',
            name: 'browse',
            meta: {
                keepAlive: true
            },
            component: Browse
        },
        {
            path: '/browseDetail/:Cellline/:uuid',
            name: 'browseDetail',
            component: BrowseDetail
        },
        {
            path: '/:pathMatch(.*)*',
            name: 'NotFound',
            component: NotFound
        }
    ]
});

export default router
